//
//  ProjectSeletedModel.m
//  XiaoMiao
//
//  Created by jinglian on 2018/2/6.
//  Copyright © 2018年 smallyou. All rights reserved.
//

#import "ProjectSeletedModel.h"
#import "ProjectSeletedCollectionViewCell.h"
#import "ProjectSeletedCell.h"

@implementation ProjectSeletedModel


+ (NSDictionary *)objectClassInArray {
    return @{@"cateViews": @"ProjectSeletedModel"};
}

+(NSDictionary*)modelContainerPropertyGenericClass{
    
    return @{@"cateViews":[ProjectSeletedModel class]};
    
}

- (CGFloat)parentTableCellHeight {
    if (_parentTableCellHeight != 0) {
        return _parentTableCellHeight;
    }
    
    NSInteger col = 0;
    if (_cateViews.count % 3) {
        col = _cateViews.count / 3 + 1;
    }else {
        col = _cateViews.count / 3;
    }
    
    return [ProjectSeletedCell topViewHeight] + [ProjectSeletedCollectionViewCell cellSize].height * col;
}

- (CGFloat)subCollectionCellHeight {
    if (_subCollectionCellHeight != 0) {
        return _subCollectionCellHeight;
    }
    
    return self.parentTableCellHeight - [ProjectSeletedCell topViewHeight];
}

@end
